﻿using OAZCSharpSdk.OAZ.Plugin.Extensions;
using OAZCSharpSdk.OAZ.Plugin.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OAZCSharpSdk.OAZ.Plugin.Events
{
    public class PluginEventArgs : EventArgs
    {
        public PluginEventArgs(long RobotQQ)
        {
            this.RobotQQ = RobotQQ;
        }

        /// <summary>
        /// 部分事件无机器人QQ时，需要手动指定才可调用API
        /// </summary>
        /// <param name="RobotQQ"></param>
        public void SetEventRobot(long RobotQQ)
        {
            this.RobotQQ = RobotQQ;
        }

        /// <summary>
        /// 触发该事件的机器人
        /// </summary>
        public long RobotQQ { get; private set; }

        /// <summary>
        /// 在框架记录页输出一行信息
        /// </summary>
        /// <param name="content">输出的内容</param>
        public void Api_OutPut(string content) => OAZ.Api_Output(content);

        /// <summary>
        /// 发送群消息
        /// </summary>
        /// <param name="GroupQQ">群号</param>
        /// <param name="MsgContent">消息内容</param>
        /// <param name="Anonymous">匿名 默认:否</param>
        public int SendGroupMessage(long GroupQQ, string MsgContent, bool Anonymous = false) => OAZ.Api_SendGroupMsg(RobotQQ, GroupQQ, MsgContent, Anonymous);

        /// <summary>
        /// 取群列表
        /// </summary>
        /// <returns></returns>
        public List<GroupInfo> GetGroups() => OAZ.Api_GetGroups(RobotQQ).JsonDeserialize<List<GroupInfo>>();

    }
}
